package com.whu.waterworks.action;

import com.opensymphony.xwork2.ActionSupport;
import com.whu.waterworks.service.WaterWorksUserService;

public class DeleteUser  extends ActionSupport{

	private static final long serialVersionUID = 8364907403307361022L;
	private String username;
	private WaterWorksUserService waterWorksUserService;
	private String result="error";
	
	@Override
	public String execute() throws Exception {
		if (waterWorksUserService.getUserByName(username)!=null) {
			if (waterWorksUserService.deleteUserByUsername(username)) {
				result = SUCCESS;
			}
		}
		return result;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public WaterWorksUserService getWaterWorksUserService() {
		return waterWorksUserService;
	}

	public void setWaterWorksUserService(WaterWorksUserService waterWorksUserService) {
		this.waterWorksUserService = waterWorksUserService;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}

}
